import request from '@/config/axios'

// 获取产品详情
export const byTypeBiz = async (bizType: number) => {
  return await request.get({ url: `/system/tenant-product/get-by-type?bizType=` + bizType })
}

// 创建支付订单
export const createPay = async (data) => {
  return await request.post({ url: `/system/pay/create`, data })
}

// 提交支付订单
export const submitOrder = async (data) => {
  return await request.post({ url: `/pay/order/submit`, data })
}

// 获取可支付的方式
export const getEnableCodeList = async (id) => {
  return await request.get({ url: `/pay/channel/get-enable-code-list?appId=` + id })
}

// 获取支付订单详情
export const getOrder = async (id) => {
  return await request.get({ url: `/pay/order/get?id=` + id })
}

// 话费账单
export const countAccount = async () => {
  return await request.get({ url: `/call/statistics/count-account` })
}

// 获取账号信息
export const simpleInfo = async () => {
  return await request.get({ url: `/system/tenant-account/simple-info` })
}

// 购买记录
export const tenantOrderPage = async (params) => {
  return await request.get({ url: `/system/tenant-order/page`, params })
}

// 查看收货地址
export const tenantOrderReceiver = async (id) => {
  return await request.get({ url: `/system/tenant-order/get-receiver?orderId=${id}` })
}
